3.4.10 \(\int \cos ^2(c+d x) (a+i a \tan (c+d x))^{5/2} \, dx\) [310]

Optimal. Leaf size=89 \[ \frac {i a^{5/2} \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} d}-\frac {i a^3 \sqrt {a+i a \tan (c+d x)}}{d (a-i a \tan (c+d x))} \]

[Out]

1/2*I*a^(5/2)*arctanh(1/2*(a+I*a*tan(d*x+c))^(1/2)*2^(1/2)/a^(1/2))/d*2^(1/2)-I*a^3*(a+I*a*tan(d*x+c))^(1/2)/d
/(a-I*a*tan(d*x+c))

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 89, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3568, 43, 65, 212} \begin {gather*} \frac {i a^{5/2} \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} d}-\frac {i a^3 \sqrt {a+i a \tan (c+d x)}}{d (a-i a \tan (c+d x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^2*(a + I*a*Tan[c + d*x])^(5/2),x]

[Out]

(I*a^(5/2)*ArcTanh[Sqrt[a + I*a*Tan[c + d*x]]/(Sqrt[2]*Sqrt[a])])/(Sqrt[2]*d) - (I*a^3*Sqrt[a + I*a*Tan[c + d*
x]])/(d*(a - I*a*Tan[c + d*x]))

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^n/(b*(
m + 1))), x] - Dist[d*(n/(b*(m + 1))), Int[(a + b*x)^(m + 1)*(c + d*x)^(n - 1), x], x] /; FreeQ[{a, b, c, d, n
}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, -1] &&  !IntegerQ[n] && GtQ[n, 0]

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rubi steps

\begin {align*} \int \cos ^2(c+d x) (a+i a \tan (c+d x))^{5/2} \, dx &=-\frac {\left (i a^3\right ) \text {Subst}\left (\int \frac {\sqrt {a+x}}{(a-x)^2} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {i a^3 \sqrt {a+i a \tan (c+d x)}}{d (a-i a \tan (c+d x))}+\frac {\left (i a^3\right ) \text {Subst}\left (\int \frac {1}{(a-x) \sqrt {a+x}} \, dx,x,i a \tan (c+d x)\right )}{2 d}\\ &=-\frac {i a^3 \sqrt {a+i a \tan (c+d x)}}{d (a-i a \tan (c+d x))}+\frac {\left (i a^3\right ) \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{d}\\ &=\frac {i a^{5/2} \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} d}-\frac {i a^3 \sqrt {a+i a \tan (c+d x)}}{d (a-i a \tan (c+d x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.74, size = 116, normalized size = 1.30 \begin {gather*} -\frac {i e^{-5 i (c+d x)} \left (\frac {a e^{2 i (c+d x)}}{1+e^{2 i (c+d x)}}\right )^{5/2} \left (1+e^{2 i (c+d x)}\right )^{5/2} \left (e^{i (c+d x)} \sqrt {1+e^{2 i (c+d x)}}-\sinh ^{-1}\left (e^{i (c+d x)}\right )\right )}{\sqrt {2} d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^2*(a + I*a*Tan[c + d*x])^(5/2),x]

[Out]

((-I)*((a*E^((2*I)*(c + d*x)))/(1 + E^((2*I)*(c + d*x))))^(5/2)*(1 + E^((2*I)*(c + d*x)))^(5/2)*(E^(I*(c + d*x
))*Sqrt[1 + E^((2*I)*(c + d*x))] - ArcSinh[E^(I*(c + d*x))]))/(Sqrt[2]*d*E^((5*I)*(c + d*x)))

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 397 vs. \(2 (73 ) = 146\).
time = 3.00, size = 398, normalized size = 4.47

method result size
default \(-\frac {\left (i \sqrt {2}\, \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \cos \left (d x +c \right ) \sin \left (d x +c \right )+\sqrt {2}\, \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \arctan \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}}{2}\right ) \cos \left (d x +c \right ) \sin \left (d x +c \right )+i \sqrt {2}\, \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \sin \left (d x +c \right )+\sqrt {2}\, \arctan \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}}{2}\right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \sin \left (d x +c \right )+8 i \left (\cos ^{4}\left (d x +c \right )\right )-8 \sin \left (d x +c \right ) \left (\cos ^{3}\left (d x +c \right )\right )-4 i \left (\cos ^{3}\left (d x +c \right )\right )+4 \left (\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )-4 i \left (\cos ^{2}\left (d x +c \right )\right )\right ) \sqrt {\frac {a \left (i \sin \left (d x +c \right )+\cos \left (d x +c \right )\right )}{\cos \left (d x +c \right )}}\, a^{2}}{4 d \left (i \sin \left (d x +c \right )+\cos \left (d x +c \right )-1\right ) \cos \left (d x +c \right )}\) \(398\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^2*(a+I*a*tan(d*x+c))^(5/2),x,method=_RETURNVERBOSE)

[Out]

-1/4/d*(I*2^(1/2)*sin(d*x+c)*cos(d*x+c)*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(3/2)*arctanh(1/2*(-2*cos(d*x+c)/(1+cos
(d*x+c)))^(1/2)*sin(d*x+c)/cos(d*x+c)*2^(1/2))+2^(1/2)*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(3/2)*arctan(1/2*(-2*cos
(d*x+c)/(1+cos(d*x+c)))^(1/2)*2^(1/2))*cos(d*x+c)*sin(d*x+c)+I*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(3/2)*2^(1/2)*ar
ctanh(1/2*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(1/2)*sin(d*x+c)/cos(d*x+c)*2^(1/2))*sin(d*x+c)+2^(1/2)*arctan(1/2*(-
2*cos(d*x+c)/(1+cos(d*x+c)))^(1/2)*2^(1/2))*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(3/2)*sin(d*x+c)+8*I*cos(d*x+c)^4-8
*sin(d*x+c)*cos(d*x+c)^3-4*I*cos(d*x+c)^3+4*cos(d*x+c)^2*sin(d*x+c)-4*I*cos(d*x+c)^2)*(a*(I*sin(d*x+c)+cos(d*x
+c))/cos(d*x+c))^(1/2)/(I*sin(d*x+c)+cos(d*x+c)-1)/cos(d*x+c)*a^2

________________________________________________________________________________________

Maxima [A]
time = 0.50, size = 98, normalized size = 1.10 \begin {gather*} -\frac {i \, {\left (\sqrt {2} a^{\frac {7}{2}} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (d x + c\right ) + a}}\right ) - \frac {8 \, \sqrt {i \, a \tan \left (d x + c\right ) + a} a^{4}}{2 i \, a \tan \left (d x + c\right ) - 2 \, a}\right )}}{4 \, a d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a+I*a*tan(d*x+c))^(5/2),x, algorithm="maxima")

[Out]

-1/4*I*(sqrt(2)*a^(7/2)*log(-(sqrt(2)*sqrt(a) - sqrt(I*a*tan(d*x + c) + a))/(sqrt(2)*sqrt(a) + sqrt(I*a*tan(d*
x + c) + a))) - 8*sqrt(I*a*tan(d*x + c) + a)*a^4/(2*I*a*tan(d*x + c) - 2*a))/(a*d)

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 236 vs. \(2 (68) = 136\).
time = 0.38, size = 236, normalized size = 2.65 \begin {gather*} \frac {\sqrt {2} \sqrt {-\frac {a^{5}}{d^{2}}} d \log \left (\frac {4 \, {\left (a^{3} e^{\left (i \, d x + i \, c\right )} - \sqrt {-\frac {a^{5}}{d^{2}}} {\left (i \, d e^{\left (2 i \, d x + 2 i \, c\right )} + i \, d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{a^{2}}\right ) - \sqrt {2} \sqrt {-\frac {a^{5}}{d^{2}}} d \log \left (\frac {4 \, {\left (a^{3} e^{\left (i \, d x + i \, c\right )} - \sqrt {-\frac {a^{5}}{d^{2}}} {\left (-i \, d e^{\left (2 i \, d x + 2 i \, c\right )} - i \, d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{a^{2}}\right ) - 2 \, \sqrt {2} {\left (i \, a^{2} e^{\left (3 i \, d x + 3 i \, c\right )} + i \, a^{2} e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{4 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a+I*a*tan(d*x+c))^(5/2),x, algorithm="fricas")

[Out]

1/4*(sqrt(2)*sqrt(-a^5/d^2)*d*log(4*(a^3*e^(I*d*x + I*c) - sqrt(-a^5/d^2)*(I*d*e^(2*I*d*x + 2*I*c) + I*d)*sqrt
(a/(e^(2*I*d*x + 2*I*c) + 1)))*e^(-I*d*x - I*c)/a^2) - sqrt(2)*sqrt(-a^5/d^2)*d*log(4*(a^3*e^(I*d*x + I*c) - s
qrt(-a^5/d^2)*(-I*d*e^(2*I*d*x + 2*I*c) - I*d)*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1)))*e^(-I*d*x - I*c)/a^2) - 2*sq
rt(2)*(I*a^2*e^(3*I*d*x + 3*I*c) + I*a^2*e^(I*d*x + I*c))*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1)))/d

________________________________________________________________________________________

Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**2*(a+I*a*tan(d*x+c))**(5/2),x)

[Out]

Exception raised: SystemError >> excessive stack use: stack is 6189 deep

________________________________________________________________________________________

Giac [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a+I*a*tan(d*x+c))^(5/2),x, algorithm="giac")

[Out]

Timed out

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\cos \left (c+d\,x\right )}^2\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^{5/2} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^2*(a + a*tan(c + d*x)*1i)^(5/2),x)

[Out]

int(cos(c + d*x)^2*(a + a*tan(c + d*x)*1i)^(5/2), x)

________________________________________________________________________________________